package com.buer.storage.service.impl;

import com.buer.storage.dao.CarprodstockdetailsDao;
import com.buer.storage.entity.CarprodstockdetailsDO;
import com.buer.storage.service.CarprodstockdetailsService;
import com.buer.storage.vo.StockDetailVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class CarprodstockdetailsServiceImpl implements CarprodstockdetailsService {
	@Autowired
	private CarprodstockdetailsDao carprodstockdetailsDao;
	
	@Override
	public CarprodstockdetailsDO get(Integer id){
		return carprodstockdetailsDao.get(id);
	}
	
	@Override
	public List<CarprodstockdetailsDO> list(Map<String, Object> map){
		return carprodstockdetailsDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return carprodstockdetailsDao.count(map);
	}
	
	@Override
	public int save(CarprodstockdetailsDO carprodstockdetails){
		return carprodstockdetailsDao.save(carprodstockdetails);
	}
	
	@Override
	public int update(CarprodstockdetailsDO carprodstockdetails){
		return carprodstockdetailsDao.update(carprodstockdetails);
	}
	
	@Override
	public int remove(Integer id){
		return carprodstockdetailsDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return carprodstockdetailsDao.batchRemove(ids);
	}

    @Override
    public PageInfo<CarprodstockdetailsDO> getCarprodstockdetailsList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<CarprodstockdetailsDO> list = carprodstockdetailsDao.getCarprodstockdetailsList(map); // 获取数据
        PageInfo<CarprodstockdetailsDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public CarprodstockdetailsDO getOne(Map<String, Object> map){
        return carprodstockdetailsDao.getOne(map);
    }

	@Override
	public List<StockDetailVo> getCarprodDetailsByCarprodId(Map<String, Object> params) {
		return carprodstockdetailsDao.getStockDetailByCarprodId(params);
	}

}
